import { useField } from "@formily/react";

export const withProps = (components: any) => {
    return components;
    // const wrapComp: any = {};
    // Object.keys(components).map((key) => {
    //     const Comp: any = components[key];
    //     const CompRef = hocWrap(Comp);
    //     wrapComp[key] = CompRef;
    // });
    // return wrapComp
}


const hocWrap = (Comp: any) => {
    return (props: any) => {
        const filed: any = useField();
        const mergeProps = {
            ...props,
            value: filed.value,
        }
        return <Comp {...mergeProps} />
    }
}
